<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.lable.yaoPinWeiHuJiLuChaKan"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %> 
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.lable.yaoPinWeiHuJiLuChaKan"/></h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.StdManage"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.proddruginfoStd"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.proddruginfoSeeStd"/></a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                    
                    <div class="form-group form-group-xs">
                        <label><spring:message code="message.listForm.xiuGaiRiQi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <input class="form-control" id="beginDate" name="beginDate" type="text" readonly="readonly" placeholder="yyyy-MM-dd"  data-date-fmt="yyyy-MM-dd"
                        onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endDate\')}'})" />
                        <label>-</label>
                        <input class="form-control" id="endDate" name="endDate" type="text" readonly="readonly" placeholder="yyyy-MM-dd"  data-date-fmt="yyyy-MM-dd"
                        onFocus="WdatePicker({minDate:'#F{$dp.$D(\'beginDate\')}'})" />
                    </div>
                    <a href="javascript:void(0);" onclick="searchData()" class="btn btn-success btn-sm"><spring:message code="message.button.seachSpacing"/></a>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
          <div class=" box box-warning bottongroup">
                <a href="${ctx}/stdProdDrugInfo/toStdProdDrugInfoList.html" class="btn btn-default btn-sm"><spring:message code="message.button.getBackSpacing"/></a>
        </div>
    </section>
   <%@ include file="/WEB-INF/component/commonJS.jsp" %>  
    <script type="text/javascript">
    
    //绑定回车
    $('#beginDate,#endDate').bind('keydown', function(event) {
        if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
            $('#searchData').click();
        }
    }); 
    
        $(function () {
            $("#gridlist").jqGrid({
                url: "${ctx}/stdProdDrugInfo/getStdProdDrugInfoLogList.html",
                mtype: "POST",
                postData: {
                    "prodId" : "${prodId}"
                },
                datatype: "json",
                autowidth: true,
                //shrinkToFit:false,
                height: 270,
                colNames: [
                           '<spring:message code="message.jqGrid.cz"/>',
                           '<spring:message code="message.listForm.xiuGaiXiangQing"/>',
                           'logid',
                           'prodId',
                           '<spring:message code="message.listForm.yaoPinBianMa"/>', 
                           '<spring:message code="message.listForm.tongYongMing"/>', 
                           '<spring:message code="message.listForm.jiXing"/>', 
                           '<spring:message code="message.listForm.guiGe"/>', 
                           '<spring:message code="message.listForm.zhuanHuanXiShu"/>',
                           '<spring:message code="message.listForm.danWei"/>',
                           '<spring:message code="message.listForm.caiZhi"/>',
                           '<spring:message code="message.listForm.shengChanQiYe"/>',
                           '<spring:message code="message.listForm.xiuGaiRen"/>',
                           '<spring:message code="message.listForm.xiuGaiShiJian"/>',
                           '<spring:message code="message.lable.status"/>'
                           ],
                colModel: [
					{ name: 'operate', index: 'note5',width:60, align: "center",sortable: false,
					    formatter : function(val, opts, rowdata) {
					     return "<a href='${ctx}/stdProdDrugInfo/toStdProdDrugInfoLogDetail.html?logId="+rowdata.logId+ "&prodId=" +rowdata.prodId+ "' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.xiangQing"/>'></a>"; 
					     }
					},
					{ name: 'detail',width:700, align: "left",sortable: false},
                    { name: 'logId', index: 'ids',hidden:true,width:100, align: "center"},
                    { name: 'prodId', index: 'ids',hidden:true,width:100, align: "center"},
                    { name: 'drugCode', width: 120 , align:"center",sortable: false,hidden:true},
                    { name: 'qualityspecName', width: 180 , align:"left" ,sortable: false,hidden:true},
                    { name: 'formName', width: 80 , align:"center" ,sortable: false,hidden:true},
                    { name: 'specName', width: 80 , align:"left" ,sortable: false,hidden:true},
                    { name: 'factor', width: 80 , align:"center" ,sortable: false,hidden:true},
                    { name: 'unitName', width: 80 , align:"center" ,sortable: false,hidden:true},
                    { name: 'materialName', width: 80 , align:"center" ,sortable: false,hidden:true},
                    { name: 'prodCompName', width: 180 , align:"left",sortable: false,hidden:true},
                    { name: 'updUser', index: 'note2',width:160, align: "center",sortable: false},
                    { name: 'updDatetime', index: 'note3',width:160, align: "center",sortable: false},
                    { name: 'status',width: 80, align:"center",sortable: false,hidden:true}
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                caption: "${code} - ${name}&nbsp;<spring:message code="message.list.WeiHuJiLuLieBiao"/>",
                jsonReader: {
                    repeatitems: false,
                    id: "logId"
                },
                gridComplete:function(){        
                    var page = $("#gridlist").jqGrid('getGridParam','page');
                    var rows = $('#gridlist').getGridParam("rowNum");
                    var maxnum = (rows*page).toString();
                    var len = (maxnum.length)*10;
                    $('.jqgfirstrow').find('td').eq(0).css('width',len+'px');
                    $('#gridlist_rn').css('width',len+'px');
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });
        
        function searchData(page) {
            var beginDate = $("#beginDate").val();
            var endDate = $("#endDate").val();
            $("#gridlist").jqGrid('setGridParam',{  
                datatype:'json',
                page : (page || 1),
                postData:{
                    "beginDate":beginDate, 
                    "endDate":endDate
                }
            }).trigger("reloadGrid"); //重新载入  
        }
        
        
        
    </script>
</body>
</html>